home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000070_icon-group-sender _Tue Mar 12 09:28:24 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Tue, 12 Mar 1996 12:35:43 MST
Date: Tue, 12 Mar 1996 09:28:24 -0600
From: jeffery@dragon.cs.utsa.edu (Clinton Jeffery)
Message-Id: <9603121528.AA18466@water.cs.utsa.edu>
To: collberg@cs.auckland.ac.nz
Cc: icon-group@cs.arizona.edu
In-Reply-To: <4i2rmk$99b@net.auckland.ac.nz> (collberg@cs.auckland.ac.nz)
Subject: Re: Viewing lots of circles
Content-Length: 1247
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
> From: collberg@cs.auckland.ac.nz (Christian Collberg)
> I need to speed up a program that prints lots
> of black and white circles. I'm using
> WAttrib("fg=white", "fillstyle=solid")
> followed by
> FillCircle(c*20, l*20, 10)
>
> Is there a faster way?
There are two options to speed this up, and both of them involve eliminating
repeated calls to WAttrib(). Option A is to build a list L of all the white
circles (a list of integers where each set of 3 integers represents a set of
parameters for FillCircle, and then make a single call to WAttrib() to set
the attribute, and then a single call using list invocation: FillCircle ! L
Option B is deeper: using Clone() you can set up two or more separate Icon
"window" values that both refer to the same window, but have different colors.
Then you don't have to call WAttrib() to draw a circle in either color:
white := Clone(&window, "fg=white", fillstyle=solid")
black := Clone(&window, "fg=black", fillstyle=solid")
every i := 1 to 10000 do {
FillCircle(white, ...)
FillCircle(black, ...)
}
Clint Jeffery
jeffery@ringer.cs.utsa.edu
Division of Computer Science
The University of Texas at San Antonio
Research http://www.cs.utsa.edu/research/plss.html